package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_handover_item", comment = "交接项配置表")
@Table(name = "neuiot_handover_item")
public class HandoverItem extends AbstractModel {

    private static final long serialVersionUID = 1L;

    /** 名称 */
    @NotBlank(message = "名称不能为空")
    @Length(max = 255, message = "名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '名称'")
    private String name;

    /** 是否为必填项 */
    @Comment("bit(1) NOT NULL COMMENT '是否为必填项'")
    private Boolean isRequired = true;

    /** 关联职能组 */
    @ManyToOne
    FunctionalGroup group;
}
